//=============================================================================
#ifndef _CLUA_H_
    #define _CLUA_H_

#include <iostream>
#include <string>

#include "CFPS.h"
#include "CLog.h"

//=============================================================================

extern "C" {
    #include "lua.h"
    #include "lualib.h"
    #include "lauxlib.h"
}

#define lua_setConst(L, name) { lua_pushnumber( L, name ); lua_setglobal( L, #name ); }

//=============================================================================
//#include "CCamera.h"
#include "CChat.h"
#include "CEntity.h"
#include "CImage.h"
#include "CLight.h"
#include "CPlayer.h"
#include "CSystem.h"
#include "CTimer.h"

#include "CLuaAPI.h"

//=============================================================================
class CLua {
    public:
        static CLua     LuaControl;

    public:
        lua_State*      Lua_Handle;

	private:
		int				NumArgs;

    public:
        CLua();

        bool OnInit();

        bool OnLoad(std::string Filename);

        void OnCleanup();

    public:
		bool PushFunction(char* Function);

		void PushArgNumber(float Value);
		void PushArgString(std::string String);

        int Call();
};

//==============================================================================

#endif

